import { axios } from '@/utils/request'
import { ExcelDownLoad } from '@/myService/FileDownLoad'

let baseUrl="/data-governance/handleMonthly";
export default {
  getHandleStatisticsByYear: function(year) {
    return axios({
      url: baseUrl + "/getHandleStatisticsByYear",
      method: "GET",
      params: { year: year }
    })
  },
  editStatisticsModal:function (data){
    return axios({
      url:baseUrl+"/editStatisticsModal",
      method:"POST",
      data:data
    })
  },
  generateExcelByYear: function (year) {
    return axios({
      url: baseUrl+"/downloadExcel",
      method: "GET",
      params: {year: year},
      responseType: 'blob'
    }).then(res => {
      ExcelDownLoad(res)
    })
  },
  downloadPretreatmentOrder: function (month){
    return axios({
      url: baseUrl+"/downloadPretreatmentOrder",
      method: "GET",
      params: {month: month},
      responseType: 'blob'
    }).then(res => {
      ExcelDownLoad(res);
    })
  },
  downloadTransferOrder:function (month) {
    return axios({
      url: baseUrl+"/downloadTransferOrder",
      method: "GET",
      params: {month: month},
      responseType: 'blob'
    }).then(res => {
      ExcelDownLoad(res);
    })
  },
  handlerStatisticsMonthly:function(params){
    return axios({
      url: baseUrl+"/handlerStatisticsMonthly",
      method: "GET",
      params: params,
    })
  },
  getPretreatmentOrder:function(params){
    return axios({
      url:baseUrl+"/getAllPretreatmentOrder",
      method:"GET",
      params:params,
    })
  },
  getAllTransferOrder:function(params){
    return axios({
      url:baseUrl+"/getAllTransferOrder",
      method:"GET",
      params:params,
    })
  },
}